//
//  TWFXWeatherInfo.m
//  TWFXWeather
//
//  Created by Lion User on 13-2-4.
//  Copyright (c) 2013年 Lion User. All rights reserved.
//

#import "TWFXStruct_FutureWeatherInfo.h"

@implementation TWFXStruct_FutureWeatherInfo

- (id)init
{
    self = [super init];
    if (self) {
        
        self.img1 = @"d100";
    }
    
    return self;
}


+ (void)FutureWeatherWithDictionary:(NSDictionary *)dicData FutureWeatherInfo:(TWFXStruct_FutureWeatherInfo *)futureWeatherInfo Error:(NSError *)error
{
    NSDictionary *tempWeather = nil;
    if (![dicData.allKeys containsObject:@"weatherinfo"])
    {
        NSLog(@"解析json格式数据出错");
        return;
    }
    else
    {

      //  tempWeather = [[[NSDictionary alloc] initWithDictionary:dicData[@"weatherInfo"]] autorelease];
        
        tempWeather = dicData[@"weatherinfo"];
    }
    
    //weatherInfo保存着解析好之后的天气信息
    if (futureWeatherInfo == nil) {
        
        futureWeatherInfo = [[TWFXStruct_FutureWeatherInfo alloc] init];
    }
    
    
    @try {
        
        futureWeatherInfo.fchh = tempWeather[@"fchh"]; //发布时间
        
        //基础信息
        futureWeatherInfo.city = tempWeather[@"city"];
        futureWeatherInfo.city_en = tempWeather[@"city_en"];
        futureWeatherInfo.date_y = tempWeather[@"date_y"];  //2012年4月1日
        futureWeatherInfo.date = tempWeather[@"date"];
        futureWeatherInfo.week = tempWeather[@"week"];
        futureWeatherInfo.cityid = tempWeather[@"cityid"];
        
        //风力情况,如 微风
        futureWeatherInfo.wind1 = tempWeather[@"wind1"];
        futureWeatherInfo.wind2 = tempWeather[@"wind2"];
        futureWeatherInfo.wind3 = tempWeather[@"wind3"];
        futureWeatherInfo.wind4 = tempWeather[@"wind4"];
        futureWeatherInfo.wind5 = tempWeather[@"wind5"];
        futureWeatherInfo.wind6 = tempWeather[@"wind6"];
        
        
        //天气对应的图标编号
        //Img_title2、4、6、8、10、12(表示晚上的天气图片)的值有可能是"99"，
        //分别表示他们的值取 Img_title1、3、5、7、9、11（表示白天的天气图片）的值。
        futureWeatherInfo.img1 = [NSString stringWithFormat:@"%@", tempWeather[@"img1"]];
        futureWeatherInfo.img2 = [NSString stringWithFormat:@"%@", tempWeather[@"img2"]];
        futureWeatherInfo.img3 = [NSString stringWithFormat:@"%@", tempWeather[@"img3"]];
        futureWeatherInfo.img4 = [NSString stringWithFormat:@"%@", tempWeather[@"img4"]];
        futureWeatherInfo.img5 = [NSString stringWithFormat:@"%@", tempWeather[@"img5"]];
        futureWeatherInfo.img6 = [NSString stringWithFormat:@"%@", tempWeather[@"img6"]];
        futureWeatherInfo.img7 = [NSString stringWithFormat:@"%@", tempWeather[@"img7"]];
        futureWeatherInfo.img8 = [NSString stringWithFormat:@"%@", tempWeather[@"img8"]];
        futureWeatherInfo.img9 = [NSString stringWithFormat:@"%@", tempWeather[@"img9"]];
        futureWeatherInfo.img10 = [NSString stringWithFormat:@"%@", tempWeather[@"img10"]];
        futureWeatherInfo.img11 = [NSString stringWithFormat:@"%@", tempWeather[@"img11"]];
        futureWeatherInfo.img12 = [NSString stringWithFormat:@"%@", tempWeather[@"img12"]];
        
        //Img2、4、6、8、10、12的值有可能是"99"，
        //分别表示他们的值取 Img1、3、5、7、9、11的值。
        if ([futureWeatherInfo.img2 isEqualToString:@"99"]) {
            
            futureWeatherInfo.img2 = futureWeatherInfo.img1;
        }
        if ([futureWeatherInfo.img4 isEqualToString:@"99"]) {
            
            futureWeatherInfo.img4 = futureWeatherInfo.img3;
        }
        if ([futureWeatherInfo.img6 isEqualToString:@"99"]) {
            
            futureWeatherInfo.img6 = futureWeatherInfo.img5;
        }
        if ([futureWeatherInfo.img8 isEqualToString:@"99"]) {
            
            futureWeatherInfo.img8 = futureWeatherInfo.img7;
        }
        if ([futureWeatherInfo.img10 isEqualToString:@"99"]) {
            
            futureWeatherInfo.img10 = futureWeatherInfo.img9;
        }
        if ([futureWeatherInfo.img12 isEqualToString:@"99"]) {
            
            futureWeatherInfo.img12 = futureWeatherInfo.img11;
        }
        
        
        //风力大小,如 3级
        futureWeatherInfo.fl1 = tempWeather[@"fl1"];
        futureWeatherInfo.fl2 = tempWeather[@"fl2"];
        futureWeatherInfo.fl3 = tempWeather[@"fl3"];
        futureWeatherInfo.fl4 = tempWeather[@"fl4"];
        futureWeatherInfo.fl5 = tempWeather[@"fl5"];
        futureWeatherInfo.fl6 = tempWeather[@"fl6"];
        
        
        //生活指数
        futureWeatherInfo.index_ag = tempWeather[@"index_ag"];
        futureWeatherInfo.index_cl = tempWeather[@"index_cl"];
        futureWeatherInfo.index_ls = tempWeather[@"index_ls"];
        futureWeatherInfo.index_ss = tempWeather[@"index_ss"];
        futureWeatherInfo.index_tr = tempWeather[@"index_tr"];
        futureWeatherInfo.index_uv = tempWeather[@"index_uv"];
        futureWeatherInfo.index_xc = tempWeather[@"index_xc"];

        
        //如果是早上发布的
        if ([futureWeatherInfo.fchh intValue] < 12) {
            
            //六天温度
            futureWeatherInfo.temp1 = tempWeather[@"temp1"];//今天
            futureWeatherInfo.temp2 = tempWeather[@"temp2"];//明天
            futureWeatherInfo.temp3 = tempWeather[@"temp3"];
            futureWeatherInfo.temp4 = tempWeather[@"temp4"];
            futureWeatherInfo.temp5 = tempWeather[@"temp5"];
            futureWeatherInfo.temp6 = tempWeather[@"temp6"];
            
            //六天的天气情况,如晴转多云
            futureWeatherInfo.weather1 = tempWeather[@"weather1"];//今天
            futureWeatherInfo.weather2 = tempWeather[@"weather2"];//明天
            futureWeatherInfo.weather3 = tempWeather[@"weather3"];
            futureWeatherInfo.weather4 = tempWeather[@"weather4"];
            futureWeatherInfo.weather5 = tempWeather[@"weather5"];
            futureWeatherInfo.weather6 = tempWeather[@"weather6"];
            
            
            
            //天气状况,两个对应weather属性里的一个,如 晴转多云
            futureWeatherInfo.img_title1 = tempWeather[@"img_title1"];//今天白天,如 晴
            futureWeatherInfo.img_title2 = tempWeather[@"img_title2"];//今天晚上,如 多云
            futureWeatherInfo.img_title3 = tempWeather[@"img_title3"];//明天白天
            futureWeatherInfo.img_title4 = tempWeather[@"img_title4"];//明天晚上
            futureWeatherInfo.img_title5 = tempWeather[@"img_title5"];
            futureWeatherInfo.img_title6 = tempWeather[@"img_title6"];
            futureWeatherInfo.img_title7 = tempWeather[@"img_title7"];
            futureWeatherInfo.img_title8 = tempWeather[@"img_title8"];
            futureWeatherInfo.img_title9 = tempWeather[@"img_title9"];
            futureWeatherInfo.img_title10 = tempWeather[@"img_title10"];
            futureWeatherInfo.img_title11 = tempWeather[@"img_title11"];
            futureWeatherInfo.img_title12 = tempWeather[@"img_title12"];
            
            
            
            //天气对应的图标编号
            //Img_title2、4、6、8、10、12(表示晚上的天气图片)的值有可能是"99"，
            //分别表示他们的值取 Img_title1、3、5、7、9、11（表示白天的天气图片）的值。
            futureWeatherInfo.img1 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img1];
            futureWeatherInfo.img2 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img2];
            futureWeatherInfo.img3 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img3];
            futureWeatherInfo.img4 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img4];
            futureWeatherInfo.img5 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img5];
            futureWeatherInfo.img6 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img6];
            futureWeatherInfo.img7 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img7];
            futureWeatherInfo.img8 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img8];
            futureWeatherInfo.img9 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img9];
            futureWeatherInfo.img10 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img10];
            futureWeatherInfo.img11 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img11];
            futureWeatherInfo.img12 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img12];
         
        
        }
      
        //如果是下午六点发布的
        else
        {
            
            //六天温度,发生错位,要重组
            futureWeatherInfo.temp1 = tempWeather[@"temp1"];//今晚到明早的天气状况,如：16°~26°，16°表示今天晚上的天气，26°表示明天白天的天气
            futureWeatherInfo.temp2 = tempWeather[@"temp2"];//明晚到后天早上的天气状况
            futureWeatherInfo.temp3 = tempWeather[@"temp3"];
            futureWeatherInfo.temp4 = tempWeather[@"temp4"];
            futureWeatherInfo.temp5 = tempWeather[@"temp5"];
            futureWeatherInfo.temp6 = tempWeather[@"temp6"];
            
            //重组temp组的信息,先分割,再合成
            NSArray *tempOne = [futureWeatherInfo.temp1 componentsSeparatedByString:@"~"];
            NSArray *tempTwo = [futureWeatherInfo.temp2 componentsSeparatedByString:@"~"];
            NSArray *tempThree = [futureWeatherInfo.temp3 componentsSeparatedByString:@"~"];
            NSArray *tempFour = [futureWeatherInfo.temp4 componentsSeparatedByString:@"~"];
            NSArray *tempFive = [futureWeatherInfo.temp5 componentsSeparatedByString:@"~"];
            NSArray *tempSix = [futureWeatherInfo.temp6 componentsSeparatedByString:@"~"];
            
            futureWeatherInfo.temp1 = [NSString stringWithFormat:@"%@~%@",@"-999℃",tempOne[0]];
            futureWeatherInfo.temp2 = [NSString stringWithFormat:@"%@~%@",tempOne[1],tempTwo[0]];
            futureWeatherInfo.temp3 = [NSString stringWithFormat:@"%@~%@",tempTwo[1],tempThree[0]];
            futureWeatherInfo.temp4 = [NSString stringWithFormat:@"%@~%@",tempThree[1],tempFour[0]];
            futureWeatherInfo.temp5 = [NSString stringWithFormat:@"%@~%@",tempFour[1],tempFive[0]];
            futureWeatherInfo.temp6 = [NSString stringWithFormat:@"%@~%@",tempFive[1],tempSix[0]];
            
            
            
            
            //天气对应的图标编号
            futureWeatherInfo.img1 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img1];
            futureWeatherInfo.img2 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img2];
            futureWeatherInfo.img3 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img3];
            futureWeatherInfo.img4 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img4];
            futureWeatherInfo.img5 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img5];
            futureWeatherInfo.img6 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img6];
            futureWeatherInfo.img7 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img7];
            futureWeatherInfo.img8 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img8];
            futureWeatherInfo.img9 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img9];
            futureWeatherInfo.img10 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img10];
            futureWeatherInfo.img11 = [NSString stringWithFormat:@"%@%@", @"n",futureWeatherInfo.img11];
            futureWeatherInfo.img12 = [NSString stringWithFormat:@"%@%@", @"d",futureWeatherInfo.img12];
            
            //如果是早上八点发布的天气，Img1、2表示今天的天气图标，3、4表示明天的天气图标
            //现在是下午六点后发布，图标已发生错位，Img2、3表示明天的天气图标
            //所以要重新组合成内容是正确的、同时格式和早上八点发布的天气信息的格式一致
            //这样子，界面就可以忽略是什么时候发布的，而只需要用Img3、4即可取得明天天气的正确的图标
            futureWeatherInfo.img12 = futureWeatherInfo.img11;
            futureWeatherInfo.img11 = futureWeatherInfo.img10;
            futureWeatherInfo.img10 = futureWeatherInfo.img9;
            futureWeatherInfo.img9 = futureWeatherInfo.img8;
            futureWeatherInfo.img8 = futureWeatherInfo.img7;
            futureWeatherInfo.img7 = futureWeatherInfo.img6;
            futureWeatherInfo.img6 = futureWeatherInfo.img5;
            futureWeatherInfo.img5 = futureWeatherInfo.img4;
            futureWeatherInfo.img4 = futureWeatherInfo.img3;
            futureWeatherInfo.img3 = futureWeatherInfo.img2;
            futureWeatherInfo.img2 = futureWeatherInfo.img1;
            
            
            
            //天气状况,两个对应weather属性里的一个,如 晴转多云
            futureWeatherInfo.img_title1 = tempWeather[@"img_title1"];//今晚
            futureWeatherInfo.img_title2 = tempWeather[@"img_title2"];//明早
            futureWeatherInfo.img_title3 = tempWeather[@"img_title3"];//明晚
            futureWeatherInfo.img_title4 = tempWeather[@"img_title4"];//后天早上
            futureWeatherInfo.img_title5 = tempWeather[@"img_title5"];
            futureWeatherInfo.img_title6 = tempWeather[@"img_title6"];
            futureWeatherInfo.img_title7 = tempWeather[@"img_title7"];
            futureWeatherInfo.img_title8 = tempWeather[@"img_title8"];
            futureWeatherInfo.img_title9 = tempWeather[@"img_title9"];
            futureWeatherInfo.img_title10 = tempWeather[@"img_title10"];
            futureWeatherInfo.img_title11 = tempWeather[@"img_title11"];
            futureWeatherInfo.img_title12 = tempWeather[@"img_title12"];
            
            
            
            //天的天气情况，如晴转多云，发生错位，已不准确
            futureWeatherInfo.weather1 = tempWeather[@"weather1"];//
            futureWeatherInfo.weather2 = tempWeather[@"weather2"];//明天，已经不准确，准确的是应该是 Img_title2 + "转" + Img_title3
            futureWeatherInfo.weather3 = tempWeather[@"weather3"];//后天，已经不准确，准确的是应该是 Img_title4  + "转" + Img_title5
            futureWeatherInfo.weather4 = tempWeather[@"weather4"];
            futureWeatherInfo.weather5 = tempWeather[@"weather5"];
            futureWeatherInfo.weather6 = tempWeather[@"weather6"];
            
            //如果白天晚上天气一样，就不用转了
            if ([futureWeatherInfo.img_title2 isEqualToString:futureWeatherInfo.img_title3]) {
                
                futureWeatherInfo.weather2 = futureWeatherInfo.img_title2;
            }
            //否则就是类似于 晴转多云 的格式
            else
            {
                futureWeatherInfo.weather2 = [NSString stringWithFormat:@"%@转%@",futureWeatherInfo.img_title2,futureWeatherInfo.img_title3];
            }
            
            if ([futureWeatherInfo.img_title4 isEqualToString:futureWeatherInfo.img_title5]) {
                
                futureWeatherInfo.weather3 = futureWeatherInfo.img_title4;
            }
            else
            {
                futureWeatherInfo.weather3 = [NSString stringWithFormat:@"%@转%@",futureWeatherInfo.img_title4,futureWeatherInfo.img_title5];
            }
            
            if ([futureWeatherInfo.img_title6 isEqualToString:futureWeatherInfo.img_title7]) {
                
                futureWeatherInfo.weather4 = futureWeatherInfo.img_title6;
            }
            else
            {
                futureWeatherInfo.weather4 = [NSString stringWithFormat:@"%@转%@",futureWeatherInfo.img_title7,futureWeatherInfo.img_title7];
            }
            
            if ([futureWeatherInfo.img_title8 isEqualToString:futureWeatherInfo.img_title9]) {
                
                futureWeatherInfo.weather5 = futureWeatherInfo.img_title8;
            }
            else
            {
                futureWeatherInfo.weather5 = [NSString stringWithFormat:@"%@转%@",futureWeatherInfo.img_title8,futureWeatherInfo.img_title9];
            }
            
            if ([futureWeatherInfo.img_title10 isEqualToString:futureWeatherInfo.img_title11]) {
                
                futureWeatherInfo.weather6 = futureWeatherInfo.img_title10;
            }
            else
            {
                futureWeatherInfo.weather6 = [NSString stringWithFormat:@"%@转%@",futureWeatherInfo.img_title10,futureWeatherInfo.img_title11];
            }
            
            
        }
        
    }
    @catch (NSException *exception) {
        
        error = [NSError errorWithDomain:exception.name code:0 userInfo:[exception userInfo]];

    }
    @finally {
        
        
    }
    
    
}



- (id) initWithCoder: (NSCoder *)coder
{
     if (self = [super init])
     {
         
         self.city = [coder decodeObjectForKey:@"city"];
         self.city_en = [coder decodeObjectForKey:@"city_en"];
         self.date_y = [coder decodeObjectForKey:@"date_y"];
         self.date = [coder decodeObjectForKey:@"date"];
         self.week = [coder decodeObjectForKey:@"week"];
         self.fchh = [coder decodeObjectForKey:@"fchh"];
         self.cityid = [coder decodeObjectForKey:@"cityid"];
                  
         self.temp1 = [coder decodeObjectForKey:@"temp1"];
         self.temp2 = [coder decodeObjectForKey:@"temp2"];
         self.temp3 = [coder decodeObjectForKey:@"temp3"];
         self.temp4 = [coder decodeObjectForKey:@"temp4"];
         self.temp5 = [coder decodeObjectForKey:@"temp5"];
         self.temp6 = [coder decodeObjectForKey:@"temp6"];
         
         self.weather1 = [coder decodeObjectForKey:@"weather1"];
         self.weather2 = [coder decodeObjectForKey:@"weather2"];
         self.weather3 = [coder decodeObjectForKey:@"weather3"];
         self.weather4 = [coder decodeObjectForKey:@"weather4"];
         self.weather5 = [coder decodeObjectForKey:@"weather5"];
         self.weather6 = [coder decodeObjectForKey:@"weather6"];
         
         self.img1 = [coder decodeObjectForKey:@"img1"];
         self.img2 = [coder decodeObjectForKey:@"img2"];
         self.img3 = [coder decodeObjectForKey:@"img3"];
         self.img4 = [coder decodeObjectForKey:@"img4"];
         self.img5 = [coder decodeObjectForKey:@"img5"];
         self.img6 = [coder decodeObjectForKey:@"img6"];
         self.img7 = [coder decodeObjectForKey:@"img7"];
         self.img8 = [coder decodeObjectForKey:@"img8"];
         self.img9 = [coder decodeObjectForKey:@"img9"];
         self.img10 = [coder decodeObjectForKey:@"img10"];
         self.img11 = [coder decodeObjectForKey:@"img11"];
         self.img12 = [coder decodeObjectForKey:@"img12"];
         
         
         self.img_title1 = [coder decodeObjectForKey:@"img_title1"];
         self.img_title2 = [coder decodeObjectForKey:@"img_title2"];
         self.img_title3 = [coder decodeObjectForKey:@"img_title3"];
         self.img_title4 = [coder decodeObjectForKey:@"img_title4"];
         self.img_title5 = [coder decodeObjectForKey:@"img_title5"];
         self.img_title6 = [coder decodeObjectForKey:@"img_title6"];
         self.img_title7 = [coder decodeObjectForKey:@"img_title7"];
         self.img_title8 = [coder decodeObjectForKey:@"img_title8"];
         self.img_title9 = [coder decodeObjectForKey:@"img_title9"];
         self.img_title10 = [coder decodeObjectForKey:@"img_title10"];
         self.img_title11 = [coder decodeObjectForKey:@"img_title11"];
         self.img_title12 = [coder decodeObjectForKey:@"img_title12"];
         
         
         self.fl1 = [coder decodeObjectForKey:@"fl1"];
         self.fl2 = [coder decodeObjectForKey:@"fl2"];
         self.fl3 = [coder decodeObjectForKey:@"fl3"];
         self.fl4 = [coder decodeObjectForKey:@"fl4"];
         self.fl5 = [coder decodeObjectForKey:@"fl5"];
         self.fl6 = [coder decodeObjectForKey:@"fl6"];
         
         
         self.wind1 = [coder decodeObjectForKey:@"wind1"];
         self.wind2 = [coder decodeObjectForKey:@"wind2"];
         self.wind3 = [coder decodeObjectForKey:@"wind3"];
         self.wind4 = [coder decodeObjectForKey:@"wind4"];
         self.wind5 = [coder decodeObjectForKey:@"wind5"];
         self.wind6 = [coder decodeObjectForKey:@"wind6"];
         
         self.index_ag = [coder decodeObjectForKey:@"index_ag"];
         self.index_uv = [coder decodeObjectForKey:@"index_uv"];
         self.index_ls = [coder decodeObjectForKey:@"index_ls"];
         self.index_ss = [coder decodeObjectForKey:@"index_ss"];
         self.index_xc = [coder decodeObjectForKey:@"index_xc"];
         self.index_tr = [coder decodeObjectForKey:@"index_tr"];


     }
    
    return self;
}


- (void) encodeWithCoder: (NSCoder *)coder
{
    
    [coder encodeObject:self.city forKey:@"city"];
    [coder encodeObject:self.city_en forKey:@"city_en"];
    [coder encodeObject:self.date_y forKey:@"date_y"];
    [coder encodeObject:self.date forKey:@"date"];
    [coder encodeObject:self.week forKey:@"week"];
    [coder encodeObject:self.fchh forKey:@"fchh"];
    [coder encodeObject:self.cityid forKey:@"cityid"];
       
    
    [coder encodeObject:self.temp1 forKey:@"temp1"];
    [coder encodeObject:self.temp2 forKey:@"temp2"];
    [coder encodeObject:self.temp3 forKey:@"temp3"];
    [coder encodeObject:self.temp4 forKey:@"temp4"];
    [coder encodeObject:self.temp5 forKey:@"temp5"];
    [coder encodeObject:self.temp6 forKey:@"temp6"];
    
    [coder encodeObject:self.weather1 forKey:@"weather1"];
    [coder encodeObject:self.weather2 forKey:@"weather2"];
    [coder encodeObject:self.weather3 forKey:@"weather3"];
    [coder encodeObject:self.weather4 forKey:@"weather4"];
    [coder encodeObject:self.weather5 forKey:@"weather5"];
    [coder encodeObject:self.weather6 forKey:@"weather6"];
    
    [coder encodeObject:self.img1 forKey:@"img1"];
    [coder encodeObject:self.img2 forKey:@"img2"];
    [coder encodeObject:self.img3 forKey:@"img3"];
    [coder encodeObject:self.img4 forKey:@"img4"];
    [coder encodeObject:self.img5 forKey:@"img5"];
    [coder encodeObject:self.img6 forKey:@"img6"];
    [coder encodeObject:self.img7 forKey:@"img7"];
    [coder encodeObject:self.img8 forKey:@"img8"];
    [coder encodeObject:self.img9 forKey:@"img9"];
    [coder encodeObject:self.img10 forKey:@"img10"];
    [coder encodeObject:self.img11 forKey:@"img11"];
    [coder encodeObject:self.img12 forKey:@"img12"];
    
    
    [coder encodeObject:self.img_title1 forKey:@"img_title1"];
    [coder encodeObject:self.img_title2 forKey:@"img_title2"];
    [coder encodeObject:self.img_title3 forKey:@"img_title3"];
    [coder encodeObject:self.img_title4 forKey:@"img_title4"];
    [coder encodeObject:self.img_title5 forKey:@"img_title5"];
    [coder encodeObject:self.img_title6 forKey:@"img_title6"];
    [coder encodeObject:self.img_title7 forKey:@"img_title7"];
    [coder encodeObject:self.img_title8 forKey:@"img_title8"];
    [coder encodeObject:self.img_title9 forKey:@"img_title9"];
    [coder encodeObject:self.img_title10 forKey:@"img_title10"];
    [coder encodeObject:self.img_title11 forKey:@"img_title11"];
    [coder encodeObject:self.img_title12 forKey:@"img_title12"];
    
    
    [coder encodeObject:self.fl1 forKey:@"fl1"];
    [coder encodeObject:self.fl2 forKey:@"fl2"];
    [coder encodeObject:self.fl3 forKey:@"fl3"];
    [coder encodeObject:self.fl4 forKey:@"fl4"];
    [coder encodeObject:self.fl5 forKey:@"fl5"];
    [coder encodeObject:self.fl6 forKey:@"fl6"];
    
    
    [coder encodeObject:self.wind1 forKey:@"wind1"];
    [coder encodeObject:self.wind2 forKey:@"wind2"];
    [coder encodeObject:self.wind3 forKey:@"wind3"];
    [coder encodeObject:self.wind4 forKey:@"wind4"];
    [coder encodeObject:self.wind5 forKey:@"wind5"];
    [coder encodeObject:self.wind6 forKey:@"wind6"];

    
    [coder encodeObject:self.index_ag forKey:@"index_ag"];
    [coder encodeObject:self.index_cl forKey:@"index_cl"];
    [coder encodeObject:self.index_ls forKey:@"index_ls"];
    [coder encodeObject:self.index_ss forKey:@"index_ss"];
    [coder encodeObject:self.index_tr forKey:@"index_tr"];
    [coder encodeObject:self.index_uv forKey:@"index_uv"];
    [coder encodeObject:self.index_xc forKey:@"index_xc"];
}


- (void)dealloc
{
    
    [_city release];
    [_city_en release];
    [_date_y release];
    [_date release];
    [_week release];
    [_fchh release];
    [_cityid release];
   
    
    [_temp1 release];
    [_temp2 release];
    [_temp3 release];
    [_temp4 release];
    [_temp5 release];
    [_temp6 release];
    
    [_weather1 release];
    [_weather2 release];
    [_weather3 release];
    [_weather4 release];
    [_weather5 release];
    [_weather6 release];
    
    [_img1 release];
    [_img2 release];
    [_img3 release];
    [_img4 release];
    [_img5 release];
    [_img6 release];
    [_img7 release];
    [_img8 release];
    [_img9 release];
    [_img10 release];
    [_img11 release];
    [_img12 release];
    
    
    [_img_title1 release];
    [_img_title2 release];
    [_img_title3 release];
    [_img_title4 release];
    [_img_title5 release];
    [_img_title6 release];
    [_img_title7 release];
    [_img_title8 release];
    [_img_title9 release];
    [_img_title10 release];
    [_img_title11 release];
    [_img_title12 release];
    
    
    [_fl1 release];
    [_fl2 release];
    [_fl3 release];
    [_fl4 release];
    [_fl5 release];
    [_fl6 release];
    
    
    [_wind1 release];
    [_wind2 release];
    [_wind3 release];
    [_wind4 release];
    [_wind5 release];
    [_wind6 release];
    
    [_index_ag release];
    [_index_ss release];
    [_index_uv release];
    [_index_ls release];
    [_index_cl release];
    [_index_xc release];
    [_index_tr release];
    
    [super dealloc];

}


@end
